<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML_DOM</title>
</head>
<body>

<div id="div1">
  div
</div>

<script>

  var div1 = document.getElementById("div1");
  var innerHTML = div1.innerHTML;
  //alert(innerHTML);
  // div 中替换文本输入框
  //div1.innerHTML = "<input type='text'>";
  // div 中追加一个文本输入框
  div1.innerHTML += "<input type='text'>";

</script>

</body>
</html>